﻿namespace SubhadraSolutions.Sharp.Utils.Data.Helpers
{
    using System;
    using System.Reflection;

    using SubhadraSolutions.Sharp.Utils.Validation;

    /// <summary>
    /// The PropertyOrdinalInfo class.
    /// </summary>
    public sealed class PropertyOrdinalInfo
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyOrdinalInfo"/> class.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="ordinal">The ordinal.</param>
        /// <param name="inputDataType">Type of the input data.</param>
        public PropertyOrdinalInfo(PropertyInfo property, int ordinal, Type inputDataType)
        {
            Guard.ArgumentNotNull(property, "property");
            Guard.ArgumentNotNull(inputDataType, "inputDataType");
            this.Property = property;
            this.Ordinal = ordinal;
            this.InputDataType = inputDataType;
        }

        /// <summary>
        /// Gets the property.
        /// </summary>
        /// <value>
        /// The property.
        /// </value>
        public PropertyInfo Property { get; private set; }

        /// <summary>
        /// Gets the ordinal.
        /// </summary>
        /// <value>
        /// The ordinal.
        /// </value>
        public int Ordinal { get; private set; }

        /// <summary>
        /// Gets the type of the input data.
        /// </summary>
        /// <value>
        /// The type of the input data.
        /// </value>
        public Type InputDataType { get; private set; }
    }
}
